package test.y2020;

import cn.hutool.core.lang.Console;

import java.util.ArrayList;
import java.util.List;
import java.util.stream.Collectors;
import java.util.stream.Stream;

/**
 * Created By  醉美柳舞之众星捧月
 *
 * @author song
 * @date 2020/11/12 15:45
 */
public class November2 {
    public static void main(String[] args) {

        int number = 1000;

        List<Integer> collect1 = Stream.iterate(1, i -> ++i).limit(number).filter(i -> number % i == 0).collect(Collectors.toList());
        Console.error(collect1);

        List<Integer> collect2 = Stream.iterate(1, i -> ++i).limit(number).filter(i -> i % 10 == 0).collect(Collectors.toList());
        Console.error(collect2);

        List<Object> objects = new ArrayList<>();
        for (int i = 1; i <= number; i++) {
            if (i % 10 == 0) {
                objects.add(i);
            }
        }
        Console.error(objects);
    }
}
